stage.set_background_color("lightblue")
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, 0, 700, 100, "gold")
sprite.turn_left(45)
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, 0, 700, 100, "gold")
sprite.turn_right(45)
sprite = codesters.Sprite("earth")
people_sprites = ['person1', 'person2', 'person3', 'person4', 'person5', 'person6',
'person7', 'person8','person9', 'person10', 'person11', 'person12']
rotate = 90
for value in people_sprites:
# add code here
sprite = codesters.Sprite(value)
stage.wait(0.5)
sprite.set_size(0.3)
t = codesters.Teacher()
try:
size_params = t.get_parameters_for_function('set_speed')
tval1 = size_params[0][0]
tval1 = int(tval1)
except:
tval1 = "DNE"
try:
params = t.find_function('set_speed')
tval2 = t.get_indent_at_line(params[0][0])
except:
tval2 = "DNE"
try:
params = t.get_parameters_for_function('move_forward')
tval3 = params[0][0]
tval3 = int(tval3)
except:
tval3 = "DNE"
try:
move_params = t.find_function('move_forward')
tval4 = t.get_indent_at_line(move_params[0][0])
except:
tval4 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 5, "Great job!")
t1.add_failure(tval1 == 2, "Did you change the number in the Set Speed command?")
t1.add_failure(tval1 == "DNE", "Did you drag out a Set Speed block?")
t1.add_failure(tval1 < 2, "Too slow! Set the speed to 5.")
t1.add_creative(tval1 > 5, "That's a good speed too!")
t2 = TestObjective()
t2.add_success(tval2 == 4, "Great job!")
t2.add_failure(tval2 == 0, "Did you indent the Set Speed under the for loop?")
t2.add_failure(tval2 > 4 and tval2 != "DNE", "You indented Set Speed too far.")
t2.add_failure(tval2 == "DNE", "Did you add a Set Speed command?")
t3 = TestObjective()
t3.add_success(tval3 == 120, "Great job!")
t3.add_failure(tval3 == 50, "Did you change the number in the Move Forward command?")
t3.add_failure(tval3 == "DNE", "Did you drag out a Move Forward block?")
t3.add_failure(tval3 < 120, "Not forward enough! Set the number in the Move Forward command to 120.")
t3.add_creative(tval3 > 120 and tval3 <130, "That's a good distance too!")
t4 = TestObjective()
t4.add_success(tval4 == 4, "Great job!")
t4.add_failure(tval4 == 0, "Did you indent the Move Forward command under the for loop?")
t4.add_failure(tval4 > 4 and tval4 != "DNE", "You indented Move Forward too far.")
t4.add_failure(tval4 == "DNE", "Did you add a Move Forward command?")
tester = TestManager()
tester.add_test_list([t1, t2, t3, t4])
tester.run_tests()
tester.display_first_feedback()